//
//  MYXCodeViewController.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/27.
//  Copyright © 2017年 hbjApple. All rights reserved.
//后期新改的邀请码，名字待定

#import "MYXCodeViewController.h"
#import "MYXNewCodeView.h"

static NSString *const MYXNewCodeViewIdentifier = @"MYXNewCodeView";
@interface MYXCodeViewController ()
@property (nonatomic, strong) UIView *backgroundView;
@property (nonatomic, strong)userinfoModel *userinfoMode;
@property (nonatomic, strong)MYXNewCodeView *MYXNewCodeVi;
@end

@implementation MYXCodeViewController
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor =[UIColor whiteColor];
    [self.view addSubview:self.backgroundView];
     self.MYXNewCodeVi                                =[[NSBundle mainBundle]loadNibNamed:MYXNewCodeViewIdentifier owner:self options:nil][0];
    self.MYXNewCodeVi.mSuperVC = self;
    [self.view addSubview:self.MYXNewCodeVi];
    [self.MYXNewCodeVi mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@(40+SafeAreaTopHeight));
        make.left.equalTo(@10);
        make.right.equalTo(@(-10));
        make.height.equalTo(@200);
    }];
    [self.MYXNewCodeVi.iconImageView sd_setImageWithURL:[NSURL URLWithString:self.userinfoMode.image] placeholderImage:[UIImage imageNamed:@"AppIcon"]];
    self.title = @"我的Boss";
    self.MYXNewCodeVi.nameLabel.text =self.userinfoMode.username;
    self.MYXNewCodeVi.contentLabel.text =self.userinfoMode.signature;
    if (self.MYXMemberMd.bossinfo.length > 1) {//当有boss时候
        self.MYXNewCodeVi.iphoneTF.text = [NSString stringWithFormat:@"我的boss:%@",self.MYXMemberMd.bossinfo];
        self.MYXNewCodeVi.iphoneTF.textColor = [UIColor lightGrayColor];
        self.MYXNewCodeVi.iphoneTF.enabled = NO;
        self.MYXNewCodeVi.sureButton.hidden = YES;
    }
    
}
- (UIView *)backgroundView
{
    if (_backgroundView == nil) {
        _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
        _backgroundView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
    }
    return _backgroundView;
}

-(void)setMYXMemberMd:(MYXMemberMdel *)MYXMemberMd{
    _MYXMemberMd = MYXMemberMd;
    self.userinfoMode =[[userinfoModel alloc]init];
    self.userinfoMode = MYXMemberMd.userinfo;
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
